<?php
            require_once('userlevel.php'); //Require/include the permissions file
            require_once('template.php'); //Require/include the template file
    session_start();
    if (is_file('installed.php')) {
        if ($_SESSION['user_loggedin']) {
            die ("Already logged in... <script>document.location.href='main.php'</script>");
        } else {
             
            template_headtag('Login');
            template_header();
            template_left();
            echo "<div class='pageheadertext'>Please Login</div>";
            loginbox();
            template_footer();
        }
    } else {
            template_headtag('Login');
            template_header();
            template_left();
            echo "EightyThree is not installed!<br /><br /><div class='installlink'><A href='install.php'>Install</a></div>";
            template_footer();
    }
?>